package com.tuzhi.sys.service.impl;

import com.tuzhi.base.jpa.repository.BaseRepo;
import com.tuzhi.base.service.impl.AbsBaseService;
import com.tuzhi.sys.jpa.entity.UserRoleMenuViewEntity;
import com.tuzhi.sys.jpa.entity.pk.UserRoleMenuPk;
import com.tuzhi.sys.jpa.repository.UserRoleMenuRepo;
import com.tuzhi.sys.service.UserRoleMenuViewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserRoleMenuViewServiceImpl extends AbsBaseService<UserRoleMenuViewEntity, UserRoleMenuPk> implements UserRoleMenuViewService {
    @Autowired
    UserRoleMenuRepo userRoleMenuRepo;

    @Override
    protected BaseRepo getThisRepo() {
        return userRoleMenuRepo;
    }

    @Override
    public List<String> loadPerms4User(Long userId) {
        return userRoleMenuRepo.loadPerms4User(userId);
    }

    @Override
    public List<String> loadUrls4User(Long userId) {
        return userRoleMenuRepo.loadUrls4User(userId);
    }

    @Override
    public List<Long> findMenuIds(Long userId) {
        return userRoleMenuRepo.findMenuIds(userId);
    }
}
